//
//  Tire.m
//  Chapt11_CarProperties_v11-01
//
//  Created by Ronald Ram on 15/03/2011.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "Tire.h"


@implementation Tire

@synthesize pressure;       //Getter-Setter for pressure
@synthesize threadDepth;    //Getter-Setter for threadDepth

//---------------START: Overloaded init methods ---------------
-(id) initWithPressure:(float)p threadDepth:(float)td
{
    if (self = [super init]) {
        pressure = p;
        threadDepth = td;
    }
    
    return (self);
}

-(id) initWithPressure:(float)p
{
    self = [self initWithPressure:p threadDepth:20.0];
    return (self);
}

-(id) initWithThreadDepth:(float)td
{
    self = [self initWithPressure:34.0 threadDepth:td];
    return (self);
}

-(id) init
{
    self = [self initWithPressure:34.0 threadDepth:20.0];
    return (self);
}
//---------------START: Overloaded init methods ---------------


-(NSString *) description
{
    return ( [NSString stringWithFormat: @"Tire Pressure: %.1f ThreadDepth: %.1f", pressure, threadDepth] );
}

@end
